Ext.util.initPortletLayout = function() //初始化显示区域
{
    var _doc = Ext.getBody();
    var _doc_w = _doc.getSize().width;
    var _doc_h = _doc.getSize().height;
    var _container = Ext.get('portlet');
    _container.setWidth(_doc_w * 8 / 10);
    _container.setHeight(_doc_h * 19 / 20);
    var _container_w = _container.getSize().width;
    var _container_h = _container.getSize().height;
    _container.dom.style.marginLeft = '-' + _container_w / 2;
    _container.dom.style.marginTop = '-' + _container_h / 2;

}
Ext.util.getPortletSize = function() //获取显示区域的大小
{
    var _container = Ext.get('portlet');
    return _container.getSize();
}
Ext.util.getCurrentUser = function() //获取当前用户
{

    return '汤武强';
}
Ext.util.go = function(className, param) {
    Ext.create(commandObj.className, commandObj.className.param);

}
//比较数组是否相同
Ext.util.compArray = function(array1, array2) {
    if ((array1 && typeof array1 === "object" && array1.constructor === Array) && (array2 && typeof array2 === "object" && array2.constructor === Array)) {
        if (array1.length == array2.length) {
            for (var i = 0; i < array1.length; i++) {
                var ggg = modeler.compObj(array1[i], array2[i]);
                if (!ggg) {
                    return false;
                }

            }

        } else {
            return false;
        }
    } else {
        throw new Error("argunment is  error ;");
    }

    return true;
};

Ext.util.getPropLength= function (obj)
{
	var len=0;
	for(var o in obj) len++
	return len;
}
Ext.util.cmpSimpleObj= function (obj1,obj2)
{
	var ret= true;
	var len1= Ext.util.getPropLength(obj1);
	var len2= Ext.util.getPropLength(obj2);
	if(len1==len2)
	{
		for(var o in obj1)
		{
			if(obj1[o]!=obj2[o])
			{
				ret=false;
				break;
			}
		}
	}
	else ret=false;
	return ret;
}

Ext.util.cmpCmd= function(cmd1,cmd2){
	var ret=false;
	if(cmd1&&cmd2)
	{
		var condition1= (cmd1.className==cmd2.className);
		var condition2=false;
		if(Ext.util.cmpSimpleObj(cmd1.param,cmd2.param))
			ret= true;
	}
	return ret;
}
Ext.util.searchObjInArr= function(obj,arr){
	var ret;
	if(Ext.isArray(arr)&&arr.length>0)
	{
		Ext.each(arr,function(o){
			if(Ext.util.compObj(o,obj))
			{
				ret=o;
				return false;
			}
		});
	}
	return ret;
}